﻿$(document).ready(function () {
    if ($("#result").html() == "添加成功" || $("#result").html() == "修改成功") {
        //$("#submitBtn").attr('disabled', 'disabled');//设置disabled属性为true，按钮不可用 
        //$("#submitBtn").css('background', '#ccc');
        //关闭当前对话框并刷新父页面
        $(window.top.document).find("#refreshBtn").click();
        window.top.art.dialog.get('systemmanagedictionarycreate').close();
    }

    $("#subMenu #editBtn").click(function () {
        if ($("table.tablelist tbody tr.tableselectedrow").length == 0) {
            alert("请先选中一行！");
            return;
        }
        
        var dicid = $("table.tablelist tbody tr.tableselectedrow").attr("id");
        var name = $("tr.tableselectedrow #dicName").val();
        var memo = $("tr.tableselectedrow #memo").val();
        var typeid = $("#typeid").val();
        var Condition = dicid + "," + name + "," + memo + "," + typeid;
        //$.ajax({
        //    type: "POST",
        //    url: "/Dictionary/Edit",
        //    data: {
        //        id : $("tr.tableselectedrow #dicId").val(),
        //        name : $("tr.tableselectedrow #dicName").val(),
        //        memo : $("tr.tableselectedrow #memo").val(),
        //        dicid : $("#tablelist tbody tr").attr("id")
        //    },
        //    dataType: "json"
        //})
        var url = "/Dictionary/Edit/" + Condition;
        artDialogForm(url, "修改字典", "systemmanagedictionarycreate", 500, 230);
    });
});